<admintpl file="header"/>
<link rel="stylesheet" href="__PUBLIC__/css/jquery.datetimepicker.css">
<link rel="stylesheet" href="__PUBLIC__/css/main.css">
<link rel="stylesheet" href="__PUBLIC__/css/act_info.css">
<link rel="stylesheet" href="__PUBLIC__/js/selectcity/cityselect.css">
<script src="__PUBLIC__/js/uploadify/jquery2.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/jquery.form.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/uploadify/uploadify.css">
<script src="__PUBLIC__/js/laydate.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/selectcity/cityselect.js"></script>


<style type="text/css">
    /*.form-horizontal .controls{*/
    /*margin-left: 0px; */
    /*}*/
    .hidden {
        display: none;
    }

    label {
        cursor: default
    }
</style>
</head>
<body>

<div class="manage">
    <span><a href="#">活动管理</a></span><span><a href="#">运营管理</a></span>
</div>

<div class="act_main"><a href="{:U('Special/main')}">活动管理</a>
        <span class="act-nav">
            <a href="{:U('Special/main',array('Type'=>3))}">秒杀活动</a>
        </span>
</div>
<div class="wrap">
    <div class="act_title">
        <div class="act_left">
            <span class="act_all" data-shoptype="{$type}">
                <a href="#" class="rehref" style="color: #000">编辑秒杀活动内容-<i class="citynameinfo" data-city>{$list.data.timesRange.cityeName}</i></a></span>
        </div>
    </div>
    <div class="form-horizontal Jactadd">
        <div class="prize">
            <!---->
            <div class="control-group">
                <label class="control-label act-info">奖品信息（<span class="busnum"><if
                        condition="$list['data']['timesRange']['gift']"><?php echo count($list['data']['timesRange']['gift']);?>
                    <else/>
                    0
                </if></span>个奖品）</label>
                <a href="javascript:void(0)" class="btn btn-info Jaddvisit">+添加奖品</a>

                <div>

                    <div class="addPrizePic">
                        <input type="radio" name="pictext" class="addPicShow" value="1" data-pictype="1"
                        <if condition="$list['data']['timesRange']['gift'][0]['GoodsItemURL']">checked
                            <else/>
                            checked
                        </if>
                        >图片展示
                    </div>
                    <div class="addPrizePic">
                        <input type="radio" name="pictext" class="addTextPicShow" value="2" data-pictype="2"
                        <if condition="$list['data']['timesRange']['gift'][0]['ShopIconURL']">checked</if>
                        >图片＋文字展示
                    </div>

                </div>
                <!--右边导航-->
                <div class="controls text-left" style="float: left;">
                    <ul>
                        <li><a href="{:U('Grab/view',array('ActivityID'=>$ActivityID))}">> <span
                                style="color: red">返回</span> </a>
                        </li>
                        <li><a href="{:U('Grab/index')}">> <span style="color: red">返回秒杀活动</span></a></li>
                    </ul>
                </div>
            </div>
            <input type="hidden" name="prizetype" class="prizetype">
            <input type="hidden" class="ActivityID" value="{$ActivityID}">
            <input type="hidden" class="AttributeID" value="{$AttributeID}">
            <input type="hidden" class="CityIDInfo" value="{$CityID}">
            <!--奖品详情-->

            <div class="prizeinfores">

                <!--奖品信息-->
                <if condition="$list['data']['timesRange']['gift']">
                    <foreach name="list['data']['timesRange']['gift']" item="gift">
                        <div class="prize-info">
                            <div class="Jcitygarbinfo">
                                <div class="del-play" data-giftid="{$gift.GiftID}"><a href="javascript:;">删除</a></div>
                                <div class="control-group">
                                    <label class="control-label ">奖品标题：</label>

                                    <div class="controls"><input type="text" name="prize_name" class="prize_name"
                                                                 value="{$gift.GoodsName}"></div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label prize-icon">奖品图片：</label>

                                    <div class="controls">
                                        <div id="coverImgInfo">
                                            <form id="imgForm" action="{:U('Grab/uploadify')}" method="post"
                                                  enctype="multipart/form-data">
                                                <input type="file" id="coverImg" name="coverImg" accept="image/*"
                                                       onchange="coverImgChange(this);">
                                                <span id="coverShopImg"><a target="_blank"
                                                                           href="<if condition='$gift[GoodsItemURL]'>{$gift.GoodsItemURL}<else/>{$gift.ShopIconURL}</if>">
                                                    预览</a></span>
                                            </form>
                                            <input type="hidden" name="ShopPic" class="shoppic" id="shoppic"
                                                   value="<if condition='$gift[GoodsItemURL]'>{$gift.GoodsItemURL}<else/>{$gift.ShopIconURL}</if>">
                                        </div>
                                    </div>
                                </div>
                                <div class="control-group dist-height">
                                    <label class="control-label">试用分店：</label>

                                    <div class="controls">
                                        <input name="branchshop" class="branch-shop" placeholder="输入优惠券id">

                                        <div class="dist-info">
                                            <a class="btn btn-danger Jdist">识别</a>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label"></label>

                                        <div class="list-group dist-list">

                                            <if condition="$gift['shopName']">
                                                <foreach name="gift['shopName']" item="shop">
                                                    <a href="#" class="list-item" data-city="{$shop.City}"
                                                       data-shopid="{$shop.ShopID}">{$shop.ShopName}</a>
                                                </foreach>
                                            </if>

                                        </div>
                                    </div>
                                </div>

                                    <div class="control-group">
                                        <label class="control-label ">使用须知：</label>

                                        <div class="controls"><textarea class="fontContent" rows="10" cols="30">{$gift['External']}</textarea></div>
                                    </div>

                                    <div class="control-group">
                                        <label class="control-label ">商家介绍：</label>
                                        <div class="controls"><textarea class="shopIntro" rows="10" cols="30">{$gift['Intro']}</textarea>
                                        </div>
                                    </div>



                                <!--<div class="control-group">-->
                                <!--<label class="control-label">其他：</label>-->
                                <!--<span class="add-prize">-->
                                <!--<a href="javascript:void(0)" class="btn btn-info Jaddprize">+添加奖品字段</a> </span>-->
                                <!--<div class="prize-deatillist">-->
                                <!--<if condition="$gift['External']">-->
                                <!--<foreach name="gift['External']" item="e" key="k">-->
                                <!--<div class="control-group font-group-res">-->
                                <!--<div class="fontfield"><span class="fieldname">添加奖品字段</span></div>-->
                                <!--<div class="fontinput"><div>-->
                                <!--<select name="fontName">-->
                                <!--<option value="{$k}">{$k}</option>-->
                                <!--</select>-->
                                <!--</div>-->
                                <!--<div><textarea class="fontContent">{$e}</textarea><a href="javascript:void(0)"><img src="/public/images/del.png"></a>-->
                                <!--</div>-->
                                <!--</div>-->
                                <!--</div>-->
                                <!--</foreach>-->
                                <!--</if>-->
                                <!--</div>-->
                                <!--</div>-->
                            </div>
                        </div>
                    </foreach>
                </if>


            </div>
        </div>

        <!-----------活动场次概况---------->
        <div class="garbtimes">
            <div class="activity-info">
                <div class="control-group">
                    <label class="control-label act-info">活动场次<!--（<span class="playnuminfo">0</span>个场次）--></label>

                    <!--<a href="javascript:void(0)">场次奖品</a>-->
                </div>
            </div>

            <div class="JactivityTotal">
                <if condition="$list['data']['timesRange']['list']">
                    <foreach name="list['data']['timesRange']['list']" item="vo" key="key">
                        <div class="Jmanyactivity Jmanyactivityinfo">
                            <div class="editActivitydetail goods-list date-{$vo.Date}" data-timeid="{$vo.TimeID}"
                                 data-date="{$vo.Date}">
                                <div class="control-group act-border-list">
                                    <div class="prize-time"><span class="getcitytime">{$key}</span></div>
                                    <div class="editaddprizelist">
                                        <label class="control-label">奖品：</label>

                                        <div class="controls">
                                            <div class="editPrizeinfo"><a href="javascript:void(0)"
                                                                          class="JeditaddPrize">添加奖品</a></div>
                                            <div class="editActivityPrizeList">

                                                <if condition="$vo['CouponList']">
                                                    <foreach name="vo['CouponList']" item="coupon" key="k">
                                                        <if condition="$vo['AmountList']">
                                                            <div class="editPrizelist">
                                                                <input type="text" name="name"
                                                                       data-couponlistid="{$coupon.CouponListID}"
                                                                       placeholder="奖品id" class="prizeid"
                                                                       value="{$coupon.CouponID}">
                                                                <input type="text" name="name" class="prize-number"
                                                                       placeholder="数量" value="{$vo.AmountList.$k}">
                                                                <a href="javascript:void(0)"><img
                                                                        src="/public/images/del.png"></a>
                                                                <span class="couponNameInfo">{$vo.CouponList.$k.CouponName}</span>
                                                            </div>
                                                        </if>
                                                    </foreach>
                                                </if>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </foreach>
                </if>
            </div>

        </div>


        <div class="form-actions">
            <button type="submit" class="btn btn-primary Jaddsubmit JaddPlayCity">保存</button>
        </div>
    </div>
</div>

<!--添加活动场次结束-->

<script type="text/javascript">
    var ajaxPicInfo = "{:U('Grab/uploadify')}";
    var ajaxGetBrach = "{:U('Grab/getBrachInfo')}";
    var ajaxAddHandel = "{:U('Grab/addHandle')}";
    var getBranchName = "{:U('Grab/getBranchName')}";
    var editacturl = "{:U('Grab/view')}";

    var m = 1;
    new Vcity.CitySelector({input: 'citySelect' + m});


    $(function () {
        $('.rehref').click(function () {
            location.reload();
        })
    })

</script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/artDialog/artDialog.js"></script>
<script src="__PUBLIC__/js/grab.js"></script>
<script src="__PUBLIC__/js/common_upload.js"></script>

</body>
</html>